//
//  TopicDetaillHeadInfoView.m
//  ZITHER
//
//  Created by 吴凡 on 2019/2/15.
//  Copyright © 2019 weixn. All rights reserved.
//

#import "TopicDetaillHeadInfoView.h"

@implementation TopicDetaillHeadInfoView

- (instancetype)init {
    if (self = [super init]) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUI];
    }
    return self;
}

- (void)setUI {
    
    _placeholderImageView = [UIImageView new];
    _placeholderImageView.image = nil;
    [self addSubview:_placeholderImageView];
    [_placeholderImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self);
        if (Is_Iphone_X_Series) {
             make.height.mas_equalTo(kScreenW/2 -88);
        } else {
             make.height.mas_equalTo(kScreenW/2 -64);
        }
       
    }];
    
    _titleLabel = [UILabel new];
    _titleLabel.text = @"     话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题话题";
    _titleLabel.font = [UIFont fontWithName:@"PingFangSC-Semibold" size:15.f];
    _titleLabel.textColor = [UIColor colorWithHex:@"#333333"];
    _titleLabel.textAlignment = NSTextAlignmentLeft;
    _titleLabel.numberOfLines = 2;
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.right.equalTo(self.mas_right).offset(-15);
        make.top.equalTo(self.placeholderImageView.mas_bottom).offset(17);
    }];
    
    _topicIcon = [UIImageView new];
    _topicIcon.image = [UIImage imageNamed:@"发布_#话题"];
    [self addSubview:_topicIcon];
    [_topicIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLabel.mas_top).offset(2);
        make.left.equalTo(self.titleLabel.mas_left).offset(0);
        make.size.mas_equalTo(CGSizeMake(13, 17));
    }];
    
    _contentLabel = [UILabel new];
    _contentLabel.text = @"内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容内容";
    _contentLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:13.f];
    _contentLabel.textColor = [UIColor colorWithHex:@"#333333"];
    _contentLabel.textAlignment = NSTextAlignmentLeft;
    _contentLabel.numberOfLines = 4;
    [self addSubview:_contentLabel];
    [_contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.right.equalTo(self.mas_right).offset(-15);
        make.top.equalTo(self.titleLabel.mas_bottom).offset(6);
    }];
    
    // 品牌中英文view
    _brandView = [UIView new];
    _brandView.backgroundColor = [UIColor clearColor];
    _brandView.layer.borderColor = [UIColor colorWithHex:@"#DEDEDE"].CGColor;
    _brandView.layer.borderWidth = 0.5f;
    [self addSubview:_brandView];
    [_brandView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(15);
        make.right.equalTo(self.mas_right).offset(-15);
        make.top.equalTo(self.contentLabel.mas_bottom).offset(21);
        make.height.mas_equalTo(70);
        make.bottom.equalTo(self.mas_bottom).offset(-21);
    }];

    _brandNameLabel = [UILabel new];
    _brandNameLabel.text = @"Vacheron Constantin";
    _brandNameLabel.font = [UIFont fontWithName:@"PingFang-SC-Regular" size:12.f];
    _brandNameLabel.textColor = [UIColor colorWithHex:@"#333333"];
    _brandNameLabel.textAlignment = NSTextAlignmentLeft;
    _brandNameLabel.numberOfLines = 1;
    [_brandView addSubview:_brandNameLabel];
    [_brandNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.brandView.mas_left).offset(21);
        make.top.equalTo(self.brandView.mas_top).offset(15);
    }];

    _brandNativeNameLabel = [UILabel new];
    _brandNativeNameLabel.text = @"江诗丹顿";
    _brandNativeNameLabel.font = [UIFont fontWithName:@"PingFang-SC-Heavy" size:17.f];
    _brandNativeNameLabel.textColor = [UIColor colorWithHex:@"#333333"];
    _brandNativeNameLabel.textAlignment = NSTextAlignmentLeft;
    _brandNativeNameLabel.numberOfLines = 1;
    [_brandView addSubview:_brandNativeNameLabel];
    [_brandNativeNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.brandNameLabel.mas_left).offset(0);
        make.top.equalTo(self.brandNameLabel.mas_bottom).offset(10);
    }];
    
}

@end
